
#ifndef __UNIT_H__
#define __UNIT_H__

#include <string>
using namespace std;

class UnitType
{
public:
    UnitType();

    bool operator==(const UnitType &unitType) const;
    bool operator!=(const UnitType &unitType) const;
};

class Unit
{
public:
    Unit(unsigned int unit, const UnitType &unitType) throw(int);

    unsigned int getValueInBaseUnit(unsigned int amount) const;
    virtual string getBaseUnitName() const { return string("");};
    bool isInSameType(const Unit &unit) const;
	bool operator<=(const Unit &unit) const;
	unsigned int operator/(const Unit &unit) const;

	virtual string formatToString(unsigned int amount) const{ return string("");};

protected:
    unsigned int unitCoefficient;

private:
    const UnitType    &unitType;

    static int numOfUnit;
};

#endif

